//time_count 模块

module time_count(
	input			sys_clk,
	input			sys_rst_n,
	
	output	reg		time_flag
);

//parameter define
parameter MAX_CNT = 25'd2500_0000;	// 计数器最大计数值 最大延时0.5s

reg	[24:0]	delay_cnt;

always @(posedge sys_clk or negedge sys_rst_n)	begin
	if(!sys_rst_n)	begin
		delay_cnt <= 25'd0;
		time_flag <= 1'b0;
	end
	else	begin
		if(delay_cnt == MAX_CNT)	begin
			time_flag <= 1'b1;
			delay_cnt <= 25'd0;
		end
		else	begin
			delay_cnt <= delay_cnt + 1'd1;
			time_flag <= 1'b0;
		end
	end

end

endmodule